import request from '@/utils/request'

/**
 * 课程列表
 * @param {*} query 
 * @returns 
 */
export function CourseList(query) {
    return request({
        url: '/drill/course/list',
        method: 'get',
        params: query
    })
}

/**
 * 课程新增
 * @param {courseName,creditHours,credit,courseCategory,brief,materialIds} data 
 * @returns 
 */
export function CourseNew(data) {
    return request({
        url: '/drill/course',
        method: 'post',
        data: data
    })
}

/**
 * 课程详情
 * @param {courseId} courseId 
 * @returns 
 */
export function CourseDetails(courseId) {
    return request({
        url: '/drill/course/' + courseId,
        method: 'get',
    })
}

/**
 * 课程修改
 * @param {*} data 
 * @returns 
 */
export function CourseModiFication(data) {
    return request({
        url: '/drill/course',
        method: 'put',
        data: data
    })
}

/**
 * 课程删除
 * @param {courseId} courseId 
 * @returns 
 */
export function CourseDelete(courseId) {
    return request({
        url: '/drill/course/' + courseId,
        method: 'delete',
    })
}

/**
 * 开始学习
 * @param {courseId} data 
 * @returns 
 */
export function StartUser(data) {
    return request({
        url: '/drill/user',
        method: 'post',
        data: data
    })
}

/**
 * 课程修改
 * @param {courseMemberId,status} data 
 * @returns 
 */
export function OverUser(data) {
    return request({
        url: '/drill/user',
        method: 'put',
        data: data
    })
}

/**
 * 课程修改
 * @param {courseId} courseId 
 * @returns 
 */
export function UserId(courseId) {
    return request({
        url: '/drill/user/selectId/' + courseId,
        method: 'get',
    })
}

